home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 51
/
051.d81
/
windows demo
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
205 lines
10 ifa=.thena=1:load"windows.o",8,1
15 poke55,.:poke56,64:clr
20 dim fr(200),fc(200),tr(200),tc(200)
25 ad=16384:goto1000
30 :
50 sys 52496,fr,fc,tr,tc,ad,fu,co,rv
55 ad=ad+(tr-fr+1)*(tc-fc+1)*2:n=n+1
60 fr(n)=fr:fc(n)=fc:tr(n)=tr:tc(n)=tc
65 return
66 :
70 fr=fr(n):fc=fc(n):tr=tr(n):tc=tc(n)
75 ad=ad-(tr-fr+1)*(tc-fc+1)*2:n=n-1
80 sys 52496,fr,fc,tr,tc,ad,8,1,1
85 return
86 :
90 c(1)=1:c(2)=15:c(3)=12:c(4)=11:
91 fora=1to4
92 sys 52496,2,2,22,37,.,4,c(a),.
93 next:return
94 :
95 c(1)=1:c(2)=15:c(3)=12:c(4)=11:
96 fora=4to1step-1
97 sys 52496,2,2,22,37,.,4,c(a),.
98 next:return
99 :
1000 poke53280,.:poke53281,.:printchr$(142)"[147][151]";
1010 fora=1to124:print"loadstar";:next:print"loadstr[157][148]a"
1020 fora=217to242:pokea,peek(a)or128:next
1030 fr=1:fc=8:tr=5:tc=31:fu=7:co=1: rv=2:gosub 50
1040 print"loadstar presents:"
1050 fr=8:fc=4:tr=16:tc=35:rv=14: gosub50
1060 print"[154] windows"
1070 print"[154] by mike maynard"
1080 print"[154] (c)opyright 1988"
1090 fr=19:fc=5:tr=23:tc=34:rv=5: gosub 50
1100 print"press space to continue.":poke198,.
1110 ifpeek(203)<>60then1110
1120 fora=1to3:gosub70:next
1130 fr=2:fc=2:tr=22:tc=37:rv=.:gosub50
1140 print"windows is a machine language "
1150 print"routine that can save, clear, "
1160 print"and put a border around a "
1170 print"rectangular area of the screen."
1180 print"it also lets you restore an "
1190 print"area that has been saved. "
1200 print"the following is the syntax: "
1210 print"[158]sys wi,fr,fc,tr,tc,ad,fu,co,rv"
1220 print"wi will always be 52496. this"
1230 print"is where the machine language"
1240 print"is located in memory."
1250 print" [159]press space to continue":poke198,.
1260 ifpeek(203)<>60then1260
1270 gosub90:gosub70
1280 fr=2:fc=2:tr=22:tc=37:rv=.:gosub50
1290 print"[158]sys wi,ur,uc,lr,lc,ad,fu,co,rv"
1300 print"ur is the upper left row"
1310 print"number. (0 - 24)"
1320 print"[158]uc is the upper left column"
1330 print"number. (0 - 39)
1340 [153]"syslr is the lower right row"
1350 [153]"number. (ur - 24)
1360 print"[158]lc is the lower right column"
1370 print"number. (uc - 39)
1380 [153]" openpress space to continue":[151]198,.
1390 [139][194](203)[179][177]60[167]1390
1400 [141]90:[141]70
1405 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
1410 [153]"syssys wi,ur,uc,lr,lc,ad,fu,co,rv"
1420 [153]"ad is the address where you"
1430 [153]"want the window data stored."
1440 [153]"note you can store data in the"
1450 [153]"ram under basic rom at"
1460 [153]"addresses 40960 - 49151."
1470 [153]"you can find the next available"
1480 [153]"address for storing a window"
1490 [153]"by using the following formula:"
1500 [153]" sysad=(lr-ur+1)*(lc-uc+1)*2"
1510 [153]"this formula comes in handy"
1520 [153]"when you wish to save multiple"
1530 [153]"windows in a 'window area'."
1540 [153]" openpress space to continue":[151]198,.
1550 [139][194](203)[179][177]60[167]1550
1560 [141]90:[141]70
1570 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
1580 [153]"syssys wi,ur,uc,lr,lc,ad,fu,co,rv"
1590 [153]"sysfu is the function that the"
1600 [153]"window will perform and is"
1610 [153]"as follows:"
1630 [153]"bits value what it does"
1640 [153]"---- ----- ------------"
1650 [153]" 0 1 save window"
1660 [153]" 1 2 clear window"
1670 [153]" 2 4 border window"
1680 [153]" 3 8 restore window"
1690 [153]" 4 16 change color"
1700 [153]" 5 32 /unused/"
1710 [153]" 6 64 /unused/"
1720 [153]" 7 128 /unused/"
1730 [153]" openpress space to continue":[151]198,.
1740 [139][194](203)[179][177]60[167]1740
1750 [141]90:[141]70
1760 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
1770 [153]"syssys wi,ur,uc,lr,lc,ad,fu,co,rv"
1780 [153]"co is the border color and"
1790 [153]"is only used when bit 2 of the"
1800 [153]"function is set."
1810 [153]"sysrv will fill the window"
1820 [153]"with a space (if it's zero)"
1830 [153]"or a reversed space (if it's"
1840 [153]"a non-zero number). if a"
1850 [153]"non-zero number is used, the"
1860 [153]"window will be reversed in the"
1870 [153]"color that corresponds to"
1880 [153]"the number used."
1890 [153]" openpress space to continue":[151]198,.
1900 [139][194](203)[179][177]60[167]1900
1910 [141]90:[141]70
1920 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
1930 [153]"syssys wi,ur,uc,lr,lc,ad,fu,co,rv"
1940 [153]"finally, the last feature,"
1950 [153]"not shown above, is optional."
1960 [153]"it lets you change the color"
1970 [153]"of the window area to any of"
1980 [153]"the 16 colors by wiping the"
1990 [153]"color memory area."
2000 [153]"to use this optional feature,"
2010 [153]"add sys,tc to the end of the"
2020 [153]"syssys statement; where systc is"
2030 [153]"the color you want the windowed"
2040 [153]"area to become."
2050 [153]" openpress space to continue":[151]198,.
2060 [139][194](203)[179][177]60[167]2060
2070 [141]90:[141]70
2080 fr[178]2:fc[178]2:tr[178]22:tc[178]37:rv[178].:[141]50
2090 [153]"sys windows by mike maynard"
2100 [153]"for a more in-depth article"
2110 [153]"on the window routine, choose"
2120 [153]"'read it' from the loadstar"
2125 [153]"menu."
2130 [153]" 1cont) re-read window docs"
2140 [153]" 2cont) multi-windows demo"
2150 [153]" 3cont) pull-down menus demo"
2160 [153]" 4cont) return to loadstar"
2170 [153]" contchoose 1cont, 2cont, 3cont or 4cont. "
2180 [161]a$:[139]a$[178]""[167]2180
2190 a[178][197](a$):[139]a[179]1[176]a[177]4[167]2180
2195 [145] a [137] 6000,3000,4000,5000
3000 [153]"on creating multiple windows!"
3010 fr[178][181]([187](.)[172]10)
3020 fc[178][181]([187](.)[172]17)
3030 tr[178][181]([187](.)[172]13)[170]fr[170]3
3040 tc[178][181]([187](.)[172]20)[170]fc[170]3
3050 co[178][181]([187](.)[172]15)[170]1
3060 rv[178][181]([187](.)[172]15)[170]1
3070 fu[178]7:[141]50
3080 [139]ad[179]49152[167]3010
3090 fr[178]19:fc[178].:tr[178]24:tc[178]39:fu[178]7:co[178]1: a[178]ad:ad[178]50496:rv[178]14:[141]50
3100 [153]"cont "n"windows were created!!"
3110 [153]" press any key to restore all windows"
3120 [151]198,.:[146]198,1
3130 [141]70:ad[178]a
3140 [129]b[178]1[164]n[171]1:[141]70:[130]
3150 [129]z[178]1[164]4:[141]90:[141]95:[130]
3250 [153]"";:[137]2170
4000 [153]"on ^^^ look up! ^^^"
4010 [153]" tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab(tab("
4020 fr[178].:fc[178].:tr[178]2:tc[178]39:co[178]6:rv[178]1:[141]50
4030 [153]" menu 1 menu 2 menu 3 menu 4"
4040 [129]l1[178]1000[164][171]400[169][171]200
4050 [129]l2[178]1[164]4
4060 [145] l2 [141] 4500,4600,4700,4800
4070 [129]l3[178]1[164]l1:[130]:[141]70
4080 [130]:[130]:[141]70
4090 [153]" ononon"
4095 [137]2170
4500 tr[178][181]([187](.)[172]16)[170]4
4505 fr[178]2:fc[178].:tc[178]9:co[178]6:rv[178]1:[141]50
4510 [153]""
4520 [129]a[178]1[164]tr[171]fr[171]1:[153][163]1)"item"a:[130]
4530 [142]
4600 tr[178][181]([187](.)[172]16)[170]4
4605 fr[178]2:fc[178]10:tc[178]19:co[178]6:rv[178]1:[141]50
4610 [153]""
4620 [129]a[178]1[164]tr[171]fr[171]1:[153][163]11)"item"a:[130]
4630 [142]
4700 tr[178][181]([187](.)[172]16)[170]4
4705 fr[178]2:fc[178]20:tr[178]12:tc[178]29:co[178]6:rv[178]1:[141]50
4710 [153]""
4720 [129]a[178]1[164]tr[171]fr[171]1:[153][163]21)"item"a:[130]
4730 [142]
4800 tr[178][181]([187](.)[172]16)[170]4
4805 fr[178]2:fc[178]30:tr[178]